from pathlib import Path

path=Path("test.txt")
contents=path.read_text()
lines=contents.splitlines()
pi_string=' '
for line in lines:
    pi_string+=line
print(pi_string)